home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / shells / zsh-3.0-p / zsh-3 / zsh-3.0-pre3 / configure.in < prev    next >
Text File  |  1996-07-10  |  19KB  |  594 lines

  1. dnl
  2. dnl  $Id: configure.in,v 2.16 1996/07/10 20:52:55 hzoli Exp $
  3. dnl
  4. dnl  Configure template for zsh.
  5. dnl  Process this file with autoconf to produce a configure script.
  6. dnl
  7. dnl  Copyright (c) 1996 Richard Coleman
  8. dnl  All rights reserved.
  9. dnl
  10. dnl  Permission is hereby granted, without written agreement and without
  11. dnl  license or royalty fees, to use, copy, modify, and distribute this
  12. dnl  software and its documentation for any purpose, provided that the
  13. dnl  above copyright notice and the following two paragraphs appear in
  14. dnl  all copies of this software.
  15. dnl
  16. dnl  In no event shall Richard Coleman or the Zsh Development Group be liable
  17. dnl  to any party for direct, indirect, special, incidental, or consequential
  18. dnl  damages arising out of the use of this software and its documentation,
  19. dnl  even if Richard Coleman and the Zsh Development Group have been advised of
  20. dnl  the possibility of such damage.
  21. dnl
  22. dnl  Richard Coleman and the Zsh Development Group specifically disclaim any
  23. dnl  warranties, including, but not limited to, the implied warranties of
  24. dnl  merchantability and fitness for a particular purpose.  The software
  25. dnl  provided hereunder is on an "as is" basis, and Richard Coleman and the
  26. dnl  Zsh Development Group have no obligation to provide maintenance,
  27. dnl  support, updates, enhancements, or modifications.
  28.  
  29. AC_INIT(Src/zsh.h)
  30. AC_CONFIG_HEADER(config.h)
  31.  
  32. dnl What version of zsh are we building ?
  33. VERSION=`sed -e 's/^.*"\(.*\)"$/\1/' ${srcdir}/Src/version.h`
  34. echo "configuring for zsh $VERSION"
  35. AC_SUBST(VERSION)dnl
  36.  
  37. dnl ----------------------------------------------
  38. dnl CHECK FOR MACHINE/VENDOR/OPERATING SYSTEM TYPE
  39. dnl ----------------------------------------------
  40. dnl Find out machine type, vendor, and operating system
  41. dnl What type of host is this?
  42. AC_CANONICAL_HOST
  43. AC_DEFINE_UNQUOTED(OSTYPE,   "$host_os")
  44. AC_DEFINE_UNQUOTED(MACHTYPE, "$host_cpu")
  45. AC_DEFINE_UNQUOTED(VENDOR,   "$host_vendor")
  46.  
  47. dnl -----------------------------
  48. dnl CHECKING COMMAND LINE OPTIONS
  49. dnl -----------------------------
  50. dnl Do you want to debug zsh?
  51. undefine([zsh-debug])dnl
  52. AC_ARG_ENABLE(zsh-debug,
  53. [  --enable-zsh-debug         use it if you want to debug zsh])
  54.  
  55. dnl Do you want zsh memory allocation routines.
  56. undefine([zsh-mem])dnl
  57. AC_ARG_ENABLE(zsh-mem,
  58. [  --enable-zsh-mem           use zsh memory allocation routines],
  59. [if test x$enableval = xyes; then
  60.   AC_DEFINE(ZSH_MEM)
  61. fi])
  62.  
  63. dnl Do you want to debug zsh memory allocation routines.
  64. undefine([zsh-mem-debug])dnl
  65. AC_ARG_ENABLE(zsh-mem-debug,
  66. [  --enable-zsh-mem-debug     debug zsh memory allocation routines],
  67. [if test x$enableval = xyes; then
  68.   AC_DEFINE(ZSH_MEM_DEBUG)
  69. fi])
  70.  
  71. dnl Do you want to print warnings when errors in memory allocation.
  72. undefine([zsh-mem-warning])dnl
  73. AC_ARG_ENABLE(zsh-mem-warning,
  74. [  --enable-zsh-mem-warning   print warnings when error in memory allocation],
  75. [if test x$enableval = xyes; then
  76.   AC_DEFINE(ZSH_MEM_WARNING)
  77. fi])
  78.  
  79. dnl Do you want to turn on error checking for free().
  80. undefine([zsh-secure-free])dnl
  81. AC_ARG_ENABLE(zsh-secure-free,
  82. [  --enable-zsh-secure-free   turn on error checking for free()],
  83. [if test x$enableval = xyes; then
  84.   AC_DEFINE(ZSH_SECURE_FREE)
  85. fi])
  86.  
  87. dnl Do you want debugging information on internal hash tables.
  88. dnl This turns on the `hashinfo' builtin command.
  89. undefine([zsh-hash-debug])dnl
  90. AC_ARG_ENABLE(zsh-hash-debug,
  91. [  --enable-zsh-hash-debug    turn on debugging of internal hash tables],
  92. [if test x$enableval = xyes; then
  93.   AC_DEFINE(ZSH_HASH_DEBUG)
  94. fi])
  95.  
  96. dnl Pathnames for global zsh scripts
  97. undefine([zshenv])dnl
  98. AC_ARG_ENABLE(etcdir,
  99. [  --enable-etcdir=directory  default directory for global zsh scripts],
  100. [etcdir="$enableval"], [etcdir=/etc])
  101.  
  102. undefine([zshenv])dnl
  103. AC_ARG_ENABLE(zshenv,
  104. [  --enable-zshenv=pathname   the full pathname of the global zshenv script],
  105. [zshenv="$enableval"],
  106. [if test "x$etcdir" = xno; then
  107.   zshenv=no
  108. else
  109.   zshenv="$etcdir/zshenv"
  110. fi])
  111. if test "x$zshenv" != xno; then
  112.   AC_DEFINE_UNQUOTED(GLOBAL_ZSHENV, "$zshenv")
  113. fi
  114.  
  115. undefine([zshrc])dnl
  116. AC_ARG_ENABLE(zshrc,
  117. [  --enable-zshrc=pathname    the full pathname of the global zshrc script],
  118. [zshrc="$enableval"],
  119. [if test "x$etcdir" = xno; then
  120.   zshrc=no
  121. else
  122.   zshrc="$etcdir/zshrc"
  123. fi])
  124. if test "x$zshrc" != xno; then
  125.   AC_DEFINE_UNQUOTED(GLOBAL_ZSHRC, "$zshrc")
  126. fi
  127.  
  128. undefine([zprofile])dnl
  129. AC_ARG_ENABLE(zprofile,
  130. [  --enable-zprofile=pathname the full pathname of the global zprofile script],
  131. [zprofile="$enableval"],
  132. [if test "x$etcdir" = xno; then
  133.   zprofile=no
  134. else
  135.   zprofile="$etcdir/zprofile"
  136. fi])
  137. if test "x$zprofile" != xno; then
  138.   AC_DEFINE_UNQUOTED(GLOBAL_ZPROFILE, "$zprofile")
  139. fi
  140.  
  141. undefine([zlogin])dnl
  142. AC_ARG_ENABLE(zlogin,
  143. [  --enable-zlogin=pathname   the full pathname of the global zlogin script],
  144. [zlogin="$enableval"],
  145. [if test "x$etcdir" = xno; then
  146.   zlogin=no
  147. else
  148.   zlogin="$etcdir/zlogin"
  149. fi])
  150. if test "x$zlogin" != xno; then
  151.   AC_DEFINE_UNQUOTED(GLOBAL_ZLOGIN, "$zlogin")
  152. fi
  153.  
  154. undefine([zlogout])dnl
  155. AC_ARG_ENABLE(zlogout,
  156. [  --enable-zlogout=pathname  the full pathname of the global zlogout script],
  157. [zlogout="$enableval"],
  158. [if test "x$etcdir" = xno; then
  159.   zlogout=no
  160. else
  161.   zlogout="$etcdir/zlogout"
  162. fi])
  163. if test "x$zlogout" != xno; then
  164.   AC_DEFINE_UNQUOTED(GLOBAL_ZLOGOUT, "$zlogout")
  165. fi
  166.  
  167. AC_SUBST(zshenv)dnl
  168. AC_SUBST(zshrc)dnl
  169. AC_SUBST(zprofile)dnl
  170. AC_SUBST(zlogin)dnl
  171. AC_SUBST(zlogout)dnl
  172.  
  173. dnl ------------------
  174. dnl CHECK THE COMPILER
  175. dnl ------------------
  176. dnl We want these before the checks, so the checks can modify their values.
  177. test -z "$CFLAGS"  && CFLAGS= auto_cflags=1
  178. if test "${enable_zsh_debug}" = yes; then
  179.   test -z "$LDFLAGS" && LDFLAGS=-g
  180. fi
  181.  
  182. AC_PROG_CC
  183.  
  184. dnl if the user hasn't specified CFLAGS, then
  185. dnl   if compiler is gcc, then use -O2 and some warning flags
  186. dnl   else use -O
  187. if test -n "$auto_cflags"; then
  188.   if test "${enable_zsh_debug}" = yes; then
  189.     if test -n "$GCC"; then
  190.       CFLAGS="$CFLAGS -Wall -Wno-implicit -Wmissing-prototypes -DDEBUG -g"
  191.     else
  192.       CFLAGS="$CFLAGS -DDEBUG -g"
  193.     fi
  194.   else
  195.     if test -n "$GCC"; then
  196.       CFLAGS="$CFLAGS -Wall -Wno-implicit -Wmissing-prototypes -O2 -DDEBUG"
  197.     else
  198.       CFLAGS="$CFLAGS -O -DDEBUG"
  199.     fi
  200.   fi
  201. fi
  202.  
  203. dnl ----------
  204. dnl SCO KLUDGE
  205. dnl ----------
  206. dnl Sco doesn't define any useful compiler symbol,
  207. dnl so we will check for sco and define __sco if
  208. dnl found.
  209. if test `echo $host_os | sed 's/^\(...\).*/\1/'` = sco; then
  210.   CFLAGS="-D__sco $CFLAGS"
  211. fi
  212.  
  213. AC_SUBST(CFLAGS)dnl
  214. AC_SUBST(LDFLAGS)dnl
  215.  
  216. AC_PROG_CPP                 dnl Figure out how to run C preprocessor.
  217. AC_PROG_GCC_TRADITIONAL     dnl Do we need -traditional flag for gcc.
  218. AC_C_CONST                  dnl Does compiler support `const'.
  219. AC_C_CROSS                  dnl Are we cross compiling.
  220. fp_C_PROTOTYPES             dnl Does compiler support ANSI prototypes.
  221. AC_CHECK_SIZEOF(long)       dnl number of bytes in a long.
  222.  
  223. dnl  Checking if compiler correctly cast signed to unsigned.
  224. AC_CACHE_CHECK(if signed to unsigned casting is broken,
  225. zsh_broken_signed_to_unsigned_casting,
  226. [AC_TRY_RUN([main(){return((int)(unsigned char)((char) -1) == 255);}],
  227.   zsh_broken_signed_to_unsigned_casting=yes,
  228.   zsh_broken_signed_to_unsigned_casting=no)])
  229. if test $zsh_broken_signed_to_unsigned_casting = yes; then
  230.   AC_DEFINE(BROKEN_SIGNED_TO_UNSIGNED_CASTING)
  231. fi
  232.  
  233. dnl ------------------
  234. dnl CHECK FOR PROGRAMS
  235. dnl ------------------
  236. AC_PROG_MAKE_SET            dnl Does make define $MAKE
  237. AC_PROG_INSTALL             dnl Check for BSD compatible `install'
  238. AC_PROG_AWK                 dnl Check for mawk,gawk,nawk, then awk.
  239.  
  240. dnl ------------------
  241. dnl CHECK HEADER FILES
  242. dnl ------------------
  243. AC_HEADER_DIRENT
  244. AC_HEADER_STDC
  245. AC_HEADER_TIME
  246. AC_HEADER_STAT
  247. AC_HEADER_SYS_WAIT
  248. AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \
  249.          termios.h sys/param.h sys/filio.h string.h memory.h \
  250.          limits.h fcntl.h libc.h sys/utsname.h sys/resource.h \
  251.          locale.h errno.h stdlib.h unistd.h)
  252.  
  253. dnl Some SCO systems cannot include both sys/time.h and sys/select.h
  254. if test $ac_cv_header_sys_time_h = yes -a $ac_cv_header_sys_select_h = yes; then
  255.   AC_CACHE_CHECK(for conflicts in sys/time.h and sys/select.h,
  256.   zsh_cv_time_h_select_h_conflicts,
  257.   [AC_TRY_COMPILE([#include <sys/time.h>
  258. #include <sys/select.h>], [int i;],
  259.   zsh_cv_time_h_select_h_conflicts=no,
  260.   zsh_cv_time_h_select_h_conflicts=yes)])
  261.   if test $zsh_cv_time_h_select_h_conflicts = yes; then
  262.     AC_DEFINE(TIME_H_SELECT_H_CONFLICTS)
  263.   fi
  264. fi
  265.  
  266. AC_CACHE_CHECK(ut_host in struct utmp, zsh_cv_func_ut_host_in_utmp,
  267. [AC_TRY_COMPILE(
  268. [#include <sys/types.h>
  269. #include <utmp.h>], [struct utmp ut; ut.ut_host;],
  270. zsh_cv_func_ut_host_in_utmp=yes, zsh_cv_func_ut_host_in_utmp=no)])
  271. if test $zsh_cv_func_ut_host_in_utmp = yes; then
  272.   have_ut_host=1
  273.   AC_DEFINE(HAVE_UT_HOST)
  274. fi
  275.  
  276. if test -z "$have_ut_host"; then
  277.   AC_CACHE_CHECK(ut_host in struct utmpx, zsh_cv_func_ut_host_in_utmpx,
  278.   [AC_TRY_COMPILE([#include <sys/types.h>
  279. #include <utmpx.h>], [struct utmpx ut; ut.ut_host;],
  280.   zsh_cv_func_ut_host_in_utmpx=yes, zsh_cv_func_ut_host_in_utmpx=no)])
  281.   if test $zsh_cv_func_ut_host_in_utmpx = yes; then
  282.     AC_DEFINE(HAVE_UTMPX_H)
  283.     AC_DEFINE(HAVE_UT_HOST)
  284.   fi
  285. fi
  286.  
  287. AC_CACHE_CHECK(POSIX termios, zsh_cv_sys_posix_termios,
  288. [AC_TRY_LINK([#include <sys/types.h>
  289. #include <unistd.h>
  290. #include <termios.h>],
  291. [/* SunOS 4.0.3 has termios.h but not the library calls.  */
  292. tcgetattr(0, 0);],
  293.   zsh_cv_sys_posix_termios=yes, zsh_cv_sys_posix_termios=no)])
  294.  
  295. if test $zsh_cv_sys_posix_termios = yes; then
  296.   AC_CACHE_CHECK(TIOCGWINSZ in termios.h,
  297.   zsh_cv_sys_tiocgwinsz_in_termios_h,
  298.   [AC_TRY_LINK([#include <sys/types.h>
  299. #include <termios.h>],
  300.   [int x = TIOCGWINSZ;],
  301.   zsh_cv_sys_tiocgwinsz_in_termios_h=yes,
  302.   zsh_cv_sys_tiocgwinsz_in_termios_h=no)])
  303. else
  304.   zsh_cv_sys_tiocgwinsz_in_termios_h=no
  305. fi
  306.  
  307. if test $zsh_cv_sys_tiocgwinsz_in_termios_h = no; then
  308.   AC_CACHE_CHECK(TIOCGWINSZ in sys/ioctl.h,
  309.   zsh_cv_sys_tiocgwinsz_in_sys_ioctl_h,
  310.   [AC_TRY_LINK([#include <sys/types.h>
  311. #include <sys/ioctl.h>],
  312.   [int x = TIOCGWINSZ;],
  313.   zsh_cv_sys_tiocgwinsz_in_sys_ioctl_h=yes,
  314.   zsh_cv_sys_tiocgwinsz_in_sys_ioctl_h=no)])
  315.   if test $zsh_cv_sys_tiocgwinsz_in_sys_ioctl_h = yes; then
  316.     AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
  317.   fi
  318. fi
  319.  
  320. AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM))
  321.  
  322. dnl -------------------
  323. dnl CHECK FOR LIBRARIES
  324. dnl -------------------
  325. dnl Prefer BSD termcap library to SysV curses library, except on certain
  326. dnl versions of AIX.
  327. if test `echo $host_os | sed 's/^.*\(aix3\.2\).*$/\1/'` = aix3.2; then
  328.   termcap_curses_order="curses ncurses termcap"
  329. else
  330.   termcap_curses_order="termcap curses ncurses"
  331. fi
  332.  
  333. for lib in $termcap_curses_order; do
  334.   AC_CHECK_LIB(${lib}, tgetent, [LIBS="$LIBS -l$lib"; break])
  335. done
  336.  
  337. dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
  338. dnl to find getdomainname and yp_all
  339. AC_CHECK_FUNCS(getdomainname)
  340. if test $ac_cv_func_getdomainname = no; then
  341.   AC_CHECK_LIB(nsl, getdomainname)
  342. fi
  343.  
  344. dnl ---------------------
  345. dnl CHECK TERMCAP LIBRARY
  346. dnl ---------------------
  347. dnl Checks for external variable ospeed in the termcap library.
  348. AC_CACHE_CHECK(if an include file defines ospeed,
  349. zsh_cv_include_defines_ospeed,
  350. [AC_TRY_LINK(
  351. [#include <sys/types.h>
  352. #if HAVE_TERMIOS_H
  353. #include <termios.h>
  354. #endif
  355. #if HAVE_TERMCAP_H
  356. #include <termcap.h>
  357. #endif], [ospeed = 0;],
  358. zsh_cv_include_defines_ospeed=yes,
  359. zsh_cv_include_defines_ospeed=no)])
  360.  
  361. if test $zsh_cv_include_defines_ospeed = no; then
  362.   AC_CACHE_CHECK(if you must define ospeed,
  363.   zsh_cv_must_define_ospeed,
  364.   [AC_TRY_LINK( ,[extern short ospeed; ospeed = 0;],
  365.   zsh_cv_must_define_ospeed=yes,
  366.   zsh_cv_must_define_ospeed=no)])
  367. fi
  368.  
  369. if test $zsh_cv_include_defines_ospeed = yes; then
  370.   AC_DEFINE(HAVE_OSPEED)
  371. elif test $zsh_cv_must_define_ospeed = yes; then
  372.   AC_DEFINE(HAVE_OSPEED)
  373.   AC_DEFINE(MUST_DEFINE_OSPEED)
  374. fi
  375.  
  376. dnl  Check if tgetent accepts NULL (and will allocate its own termcap buffer)
  377. AC_CACHE_CHECK(if tgetent accepts NULL,
  378. zsh_cv_tgetent_accepts_null,
  379. [AC_TRY_RUN([main(){int i = tgetent((char*)0,"vt100");exit(!i || i == -1);}],
  380.   zsh_cv_tgetent_accepts_null=yes,
  381.   zsh_cv_tgetent_accepts_null=no)])
  382. if test $zsh_cv_tgetent_accepts_null = yes; then
  383.   AC_DEFINE(TGETENT_ACCEPTS_NULL)
  384. fi
  385.  
  386. dnl --------------
  387. dnl CHECK TYPEDEFS
  388. dnl --------------
  389. AC_TYPE_SIGNAL
  390. AC_TYPE_PID_T
  391. AC_TYPE_OFF_T
  392. AC_TYPE_MODE_T
  393. AC_TYPE_UID_T
  394. AC_TYPE_SIZE_T
  395.  
  396. dnl Check for sigset_t.  Currently I'm looking in
  397. dnl <sys/types.h> and <signal.h>.  Others might need
  398. dnl to be added.
  399. AC_CACHE_CHECK(for sigset_t, zsh_cv_sigset_t,
  400. [AC_TRY_COMPILE(
  401. [#include <sys/types.h>
  402. #include <signal.h>], [sigset_t tempsigset;],
  403.   zsh_cv_sigset_t=yes, zsh_cv_sigset_t=no)])
  404. if test $zsh_cv_sigset_t = no; then
  405.   AC_DEFINE(sigset_t, unsigned int)
  406. fi
  407.  
  408. dnl Check for struct timezone since some old SCO versions do not define it
  409. AC_CACHE_CHECK(for struct timezone, zsh_cv_struct_timezone,
  410. [AC_TRY_COMPILE(
  411. [#include <sys/time.h>], [struct timezone dummy_tz;],
  412.   zsh_cv_struct_timezone=yes, zsh_cv_struct_timezone=no)])
  413. if test $zsh_cv_struct_timezone = yes; then
  414.   AC_DEFINE(HAVE_STRUCT_TIMEZONE)
  415. fi
  416.  
  417. dnl ---------------
  418. dnl CHECK FUNCTIONS
  419. dnl ---------------
  420. AC_FUNC_GETPGRP
  421.  
  422. dnl need to integrate this function
  423. dnl AC_FUNC_STRFTIME
  424.  
  425. AC_CHECK_FUNCS(strftime waitpid select tcsetpgrp tcgetattr strstr lstat \
  426.               getlogin setpgid gettimeofday gethostname mkfifo wait3 difftime  \
  427.               sigblock sigsetmask sigrelse sighold killpg sigaction getrlimit  \
  428.               sigprocmask setuid seteuid setreuid setresuid strerror strcoll)
  429.  
  430. dnl -------------
  431. dnl CHECK SIGNALS
  432. dnl -------------
  433. dnl What style of signal do you have (POSIX, BSD, or SYSV)?
  434. AC_MSG_CHECKING(what style of signals to use)
  435. if test $ac_cv_func_sigaction = yes -a $ac_cv_func_sigprocmask = yes; then
  436.   signals_style=POSIX_SIGNALS
  437.   AC_DEFINE(POSIX_SIGNALS)
  438. elif test $ac_cv_func_sigblock = yes -a $ac_cv_func_sigsetmask = yes; then
  439.   signals_style=BSD_SIGNALS
  440.   AC_DEFINE(BSD_SIGNALS)
  441. elif test $ac_cv_func_sighold = yes -a $ac_cv_func_sigrelse = yes; then
  442.   signals_style=SYSV_SIGNALS
  443.   AC_DEFINE(SYSV_SIGNALS)
  444. else
  445.   signals_style=NO_SIGNAL_BLOCKING
  446.   AC_DEFINE(NO_SIGNAL_BLOCKING)
  447. fi
  448. AC_DEFINE_UNQUOTED($signals_style)
  449. AC_MSG_RESULT($signals_style)
  450.  
  451. dnl Where is <signal.h> located?  Needed as input for signals.awk
  452. AC_MSG_CHECKING(where signal.h is located)
  453. for SIGNAL_H in /usr/include/bsd/sys/signal.h   dnl Next
  454.                 /usr/include/asm/signal.h       dnl Linux 1.3.0 and above
  455.                 /usr/include/linux/signal.h     dnl Linux up to 1.2.11
  456.                 /usr/include/sys/signal.h       dnl Almost everybody else
  457.                 /dev/null;                      dnl Just in case we fall through
  458. do
  459.   test -f $SIGNAL_H && \
  460.   grep '#[     ]*define[     ][     ]*SIG[0-9A-Z]*[     ]*[0-9][0-9]*' $SIGNAL_H > /dev/null && \
  461.   break
  462. done
  463. AC_MSG_RESULT($SIGNAL_H)
  464. AC_SUBST(SIGNAL_H)dnl
  465.  
  466. dnl ----------------------------
  467. dnl CHECK FOR /dev/fd FILESYSTEM
  468. dnl ----------------------------
  469. AC_CACHE_CHECK(for /dev/fd filesystem, zsh_cv_have_dev_fd,
  470. [test -d /dev/fd && zsh_cv_have_dev_fd=yes || zsh_cv_have_dev_fd=no])
  471. if test $zsh_cv_have_dev_fd = yes; then
  472.   AC_DEFINE(HAVE_DEV_FD)
  473. fi
  474.  
  475. dnl ---------------------------------
  476. dnl CHECK FOR RFS SUPERROOT DIRECTORY
  477. dnl ---------------------------------
  478. AC_CACHE_CHECK(for RFS superroot directory, zsh_cv_have_superroot,
  479. [test -d /../.LOCALROOT && zsh_cv_have_superroot=yes || zsh_cv_have_superroot=no])
  480. if test $zsh_cv_have_superroot = yes; then
  481.   AC_DEFINE(HAVE_SUPERROOT)
  482. fi
  483.  
  484. dnl -------------
  485. dnl CHECK FOR NIS
  486. dnl -------------
  487. AC_CACHE_CHECK(for NIS, zsh_cv_have_nis,
  488. [test -f /usr/bin/ypcat && /usr/bin/ypcat passwd.byname > /dev/null 2>&1 && \
  489. zsh_cv_have_nis=yes || zsh_cv_have_nis=no])
  490. if test $zsh_cv_have_nis = yes; then
  491.   AC_DEFINE(HAVE_NIS)
  492. fi
  493.  
  494. dnl -----------------
  495. dnl CHECK FOR NISPLUS
  496. dnl -----------------
  497. AC_CACHE_CHECK(for NIS+, zsh_cv_have_nis_plus,
  498. [test -f /usr/bin/nisls && /usr/bin/nisls > /dev/null 2>&1 && \
  499. zsh_cv_have_nis_plus=yes || zsh_cv_have_nis_plus=no])
  500. if test $zsh_cv_have_nis_plus = yes; then
  501.   AC_DEFINE(HAVE_NIS_PLUS)
  502. fi
  503.  
  504. dnl -------------------------------
  505. dnl CHECK FOR LOCATION OF UTMP FILE
  506. dnl -------------------------------
  507. AC_MSG_CHECKING(where utmp is located)
  508. for utmp_file in /etc/utmp       dnl
  509.                  /usr/etc/utmp   dnl
  510.                  /var/adm/utmp   dnl
  511.                  /usr/adm/utmp   dnl
  512.                  /var/run/utmp   dnl
  513.                  /dev/null;      dnl Just in case we fall through
  514. do
  515.   test -f $utmp_file && break
  516. done
  517. AC_MSG_RESULT($utmp_file)
  518. AC_DEFINE_UNQUOTED(UTMP_FILE_CONFIG, "$utmp_file")
  519.  
  520. dnl -------------------------------
  521. dnl CHECK FOR LOCATION OF WTMP FILE
  522. dnl -------------------------------
  523. AC_MSG_CHECKING(where wtmp is located)
  524. for wtmp_file in /etc/wtmp      dnl
  525.                  /usr/etc/wtmp  dnl
  526.                  /var/adm/wtmp  dnl
  527.                  /usr/adm/wtmp  dnl
  528.                  /var/log/wtmp  dnl
  529.                  /dev/null;     dnl Just in case we fall through
  530. do
  531.   test -f $wtmp_file && break
  532. done
  533. AC_DEFINE_UNQUOTED(WTMP_FILE_CONFIG, "$wtmp_file")
  534. AC_MSG_RESULT($wtmp_file)
  535.  
  536. dnl ----------------------------
  537. dnl TYPEAHEAD KLUDGE FOR ULTRIX
  538. dnl ----------------------------
  539. dnl Some systems clobber typeahead when you go from canonical input
  540. dnl processing to non-canonical, so we need a FIONREAD ioctl.
  541. dnl I don't know how to check this with configure, so I am using the
  542. dnl system names directly.
  543. dnl The doubled square brackets are necessary because autoconf uses m4.
  544. AC_CACHE_CHECK(if typeahead needs FIONREAD, zsh_cv_clobbers_typeahead,
  545. [test `echo $host_os | sed 's/^\([[a-z]]*\).*/\1/'` = ultrix &&
  546. zsh_cv_clobbers_typeahead=yes || zsh_cv_clobbers_typeahead=no])
  547. if test $zsh_cv_clobbers_typeahead = yes; then
  548.   AC_DEFINE(CLOBBERS_TYPEAHEAD)
  549. fi
  550.  
  551. dnl -------------------
  552. dnl brk/sbrk PROTOTYPES
  553. dnl -------------------
  554. AC_CACHE_CHECK(for brk() prototype in <unistd.h>,
  555. zsh_cv_brk_proto_in_unistd_h,
  556. [AC_TRY_COMPILE([#include <unistd.h>
  557. double brk();], [int i;],
  558. zsh_cv_brk_proto_in_unistd_h=no, zsh_cv_brk_proto_in_unistd_h=yes)])
  559. if test $zsh_cv_brk_proto_in_unistd_h = yes; then
  560.   AC_DEFINE(HAVE_BRK_PROTO)
  561. fi
  562.  
  563. AC_CACHE_CHECK(for sbrk() prototype in <unistd.h>,
  564. zsh_cv_sbrk_proto_in_unistd_h,
  565. [AC_TRY_COMPILE([#include <unistd.h>
  566. double sbrk();], [int i;],
  567. zsh_cv_sbrk_proto_in_unistd_h=no, zsh_cv_sbrk_proto_in_unistd_h=yes)])
  568. if test $zsh_cv_sbrk_proto_in_unistd_h = yes; then
  569.   AC_DEFINE(HAVE_SBRK_PROTO)
  570. fi
  571.  
  572. AC_OUTPUT(Makefile Src/Makefile Doc/Makefile Etc/Makefile Misc/Makefile \
  573. Util/Makefile Functions/Makefile StartupFiles/Makefile, \
  574. [test -z "$CONFIG_HEADERS" || echo > stamp-h])
  575.  
  576. eval "zshbin1=${bindir}"
  577. eval "zshbin2=${zshbin1}"
  578. eval "zshman=${mandir}"
  579. eval "zshinfo=${infodir}"
  580.  
  581. echo "
  582. zsh configuration
  583. -----------------
  584. zsh version           : ${VERSION}
  585. host operating system : ${host_os}
  586. source code location  : ${srcdir}
  587. compiler              : ${CC}
  588. compiler flags        : ${CFLAGS}
  589. binary install path   : ${zshbin2}
  590. man page install path : ${zshman}
  591. info install path     : ${zshinfo}"
  592. echo ""
  593.  
  594.